"UIPATH 3"="Program Options\Built in Windows Apps\Windows Scripting Host"
"NAME"="Script Files"
"LANGUAGE"="VBScript"
"VERSION"="1.07"
"TEXT 1"="Open *.VBS/*.VBE with Notepad when opened"
"TEXT 2"="Open *.JS/*.JSE with Notepad when opened"
"TEXT 3"="Open *.WSH/*.WSF with Notepad when opened"
"DESCRIPTION 1"="Script files are powerful to automate common tasks but they are also a security problem. Some mad people use script files to create viruses (e.g. the "I LOVE YOU" virus in May 2000) so it's better to have a look at the files before executing them."
"DESCRIPTION 2"="If the checkbox is activated, a double click on a script file will open Notepad instead of executing the script. This way, you can review the file before executing it. "
"DESCRIPTION 3"="After this review, just select the file, right click and select "Open" from the appearing menu to execute the script finally."
"AUTHOR"="Xteq Systems"
"CONTACTURL"="http://www.xteq.com"
"COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
"COMMENT 1"="Thanks to sampabw for the bug notice!"
sDefault_a="HKCR\"
sDefault_b="\Shell\@"
sDefault_Value="Edit"
sDefault_Edit_a="HKCR\"
sDefault_Edit_b="\Shell\Edit\Command\@"
sDefault_Edit_Cmd="Notepad.exe %1"
sP1a="HKCR\.VBS\@"
sP1b="HKCR\.VBE\@"
sP2a="HKCR\.JS\@"
sP2b="HKCR\.JSE\@"
sP3a="HKCR\.WSH\@"
sP3b="HKCR\.WSF\@"
Sub Plugin_Initialize
b1=ReadStatus(sP1a)
b2=ReadStatus(sP1b)
if b1=true and b2=true then SetUIElement 1,true
b1=ReadStatus(sP2a)
b2=ReadStatus(sP2b)
if b1=true and b2=true then SetUIElement 2,true
b1=ReadStatus(sP3a)
b2=ReadStatus(sP3b)
if b1=true and b2=true then SetUIElement 3,true
End Sub
Sub Plugin_CheckData(ElementIndex)
End Sub
Sub Plugin_Apply(ElementIndex,ElementSubIndex)
Call WriteChanges(sP1a,GetUIElement(1))
Call WriteChanges(sP1b,GetUIElement(1))
Call WriteChanges(sP2a,GetUIElement(2))
Call WriteChanges(sP2b,GetUIElement(2))
Call WriteChanges(sP3a,GetUIElement(3))
Call WriteChanges(sP3b,GetUIElement(3))
End Sub
Sub Plugin_Terminate
End Sub
Function ReadStatus(key)
s=RegReadValue(key)
'Debugmsg s
'if this value is empty, the script file does simply not exist so
'set it to false
if IsEmpty(s)=true or len(s)=0 then
ReadStatus=false
else
s=sDefault_a & s & sDefault_b
s=RegReadValue(s)
if s=sDefault_Value then
ReadStatus=true
else
ReadStatus=false
end if
end if
End Function
Sub WriteChanges(key,activated)
sPathFirst=RegReadValue(key)
'Debugmsg s
'same as above. If empty, simply ignore it...
if IsEmpty(sPathFirst)=true or len(sPathFirst)=0 then